/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 结果库采集状态
 *
 * @author hxloongs
 * @date 2025-4-15
 */
@AllArgsConstructor
@Getter
public enum IsfdMeshOp2CompareObjectBaseRoundEnum {
    BASE(1, "基本轮次"),
    NOT_BASE(2, "非基本轮次");
    private final Integer value;
    private final String desc;

    public static String getDescByValue(Integer value) {
        IsfdMeshOp2CompareObjectBaseRoundEnum isfdMeshOp2CompareObjectBaseRoundEnum = forValue(value);
        if (isfdMeshOp2CompareObjectBaseRoundEnum == null) {
            return null;
        }
        return isfdMeshOp2CompareObjectBaseRoundEnum.getDesc();
    }

    public static IsfdMeshOp2CompareObjectBaseRoundEnum forValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (IsfdMeshOp2CompareObjectBaseRoundEnum isfdMeshOp2CompareObjectBaseRoundEnum : IsfdMeshOp2CompareObjectBaseRoundEnum.values()) {
            if (isfdMeshOp2CompareObjectBaseRoundEnum.getValue().equals(value)) {
                return isfdMeshOp2CompareObjectBaseRoundEnum;
            }
        }
        return null;
    }

    public static IsfdMeshOp2CompareObjectBaseRoundEnum forDesc(String desc) {
        if (desc == null) {
            return null;
        }
        for (IsfdMeshOp2CompareObjectBaseRoundEnum isfdMeshOp2CompareObjectBaseRoundEnum : IsfdMeshOp2CompareObjectBaseRoundEnum.values()) {
            if (desc.equals(isfdMeshOp2CompareObjectBaseRoundEnum.getDesc())) {
                return isfdMeshOp2CompareObjectBaseRoundEnum;
            }
        }
        return null;
    }
}
